OBJ=build/main.o \
 	build/cwhttprequest.o build/cwhttpreply.o \
	build/loginbusiness.o build/signupbusiness.o build/businessfactory.o \
	build/mysqlconn.o build/redisconn.o

target=build/test

c++11 = -std=c++11
GPC = g++ -c

$(target) : $(OBJ)
	g++ -o $(target) $(OBJ) $(c++11) -lmysqlclient -lhiredis -ljsoncpp
# ====================主函数====================
build/main.o : main.cpp
	$(GPC) main.cpp -o build/main.o $(c++11)
# ================ ==http请求解析=================
build/cwhttprequest.o : http/cwhttprequest.cpp
	$(GPC) http/cwhttprequest.cpp -o build/cwhttprequest.o $(c++11)
build/cwhttpreply.o : http/cwhttpreply.cpp
	$(GPC) http/cwhttpreply.cpp -o build/cwhttpreply.o $(c++11)
# ====================登陆业务====================
build/loginbusiness.o : business/loginbusiness.cpp
	$(GPC) business/loginbusiness.cpp -o build/loginbusiness.o $(c++11)
# ====================注册业务====================
build/signupbusiness.o : business/signupbusiness.cpp
	$(GPC) business/signupbusiness.cpp -o build/signupbusiness.o $(c++11)
# ====================业务工厂====================
build/businessfactory.o : business/businessfactory.cpp
	$(GPC) business/businessfactory.cpp -o build/businessfactory.o $(c++11)
# ===================MYSQL连接====================
build/mysqlconn.o : dataconn/mysqlconn.cpp
	$(GPC) dataconn/mysqlconn.cpp -o build/mysqlconn.o $(c++11)
# ===================Redis连接====================
build/redisconn.o : dataconn/redisconn.cpp
	$(GPC) dataconn/redisconn.cpp -o build/redisconn.o $(c++11)

clean:
	rm build/*.o build/test